package com.ydd.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.ydd.dto.LinkDTO;
import com.ydd.dto.LinkPageQueryDTO;
import com.ydd.entity.YddLink;
import com.ydd.vo.LinkVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @Description TODO
 * @Author fang
 * @Date 2023-05-29 16:10
 */
@Mapper
public interface YddLinkMapper extends BaseMapper<YddLink> {
    @Select("select * from ydd_link where id=#{id}")
    LinkVO linkRowinfo(Long id);

    void updateLink(LinkDTO linkDTO);
@Delete("delete from ydd_link where id =#{id}")
    void deleteLink(Long id);
@Insert("insert into ydd_link(des,img,title,type,url)values (#{des},#{img},#{title},#{type},#{url})")
    void addLink(LinkDTO linkDTO);

    Page<LinkVO> listLink(LinkPageQueryDTO linkPageQueryDTO);
}
